package com.xidian.edu.cn.product.feign.fallback;

import com.xidian.edu.cn.common.exception.BizCodeEnum;
import com.xidian.edu.cn.common.utils.R;
import com.xidian.edu.cn.product.feign.SeckillFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component//给容器中添加这个组件
public class SeckillFeignServiceFallBack implements SeckillFeignService {

    @Override
    public R getSkuSeckillInfo(Long skuId) {
        log.info("熔断方法调用...");
        return R.error(BizCodeEnum.TOO_MANY_REQUEST.getCode(), BizCodeEnum.TOO_MANY_REQUEST.getMessage());
    }
}
